layui.use(['jquery','layer','form',"laydate"],function(){
    var $=layui.jquery;
    var layer=layui.layer;
    var form=layui.form;
    var laydate = layui.laydate;
    laydate.render({
        elem:"#startDate",
        type:'datetime'

    });
    laydate.render({
        elem:"#endDate",
        type:'datetime'

    });

    $.ajax({
        url:"/JsUserCoupon/selectAllcouponName",
        // 查询优惠券的名称
        data:{},
        type:'post',
        dataType:'json',
        success:function (data) {

            for (var i = 0; i < data.data.length; i++){
                $("#couponName").append('<option value="'+ data.data[i].couponName+'">' + data.data[i].couponName +'</option>');
                $("#startDate").append('<option value="'+ data.data[i].startDate+'">' + data.data[i].startDate +'</option>');
                $("#endDate").append('<option value="'+ data.data[i].endDate+'">' + data.data[i].endDate +'</option>');
                form.render();
            }
        }
    });


})